/**
 * @param {string} s
 * @return {number}
 */
var maxUniqueSplit = function(s) {
  let maxNum = 0, set = new Set();
  function dfs(begin) {
    if(begin == s.length) {
      // console.log("maxNum", maxNum, "set", set.size);
      maxNum = Math.max(maxNum, set.size);
      // console.log("maxNum", maxNum);
      return ;
    }
    for(let i = begin; i < s.length; i++) {
      let tempStr = s.substring(begin, i + 1);
      if(tempStr.length > 0 && !set.has(tempStr)) {
        set.add(tempStr)
        dfs(i + 1);
        set.delete(tempStr);
      }
    }
  }
  dfs(0);
  return maxNum;
};
let s = "ababccc";
console.log(maxUniqueSplit(s));
s = "aba";
console.log(maxUniqueSplit(s));
s = "aa";
console.log(maxUniqueSplit(s));
s = "wwwzfvedwfvhsww";
console.log(maxUniqueSplit(s));
